package com.example.utils.config;

import java.io.File;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 资源配置
 * 
 * @author lit
 */
@Configuration
public class ResourcesConfig implements WebMvcConfigurer{

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry){
        /** 资源位置 */
    	registry.addResourceHandler("/*")
	    	.addResourceLocations("classpath:/resources/static");
        registry.addResourceHandler("/api/excel/*")
        	.addResourceLocations("file:" + CommonConfig.getProfile() + File.separator);
        
    }
 
}